/*
* @Author: Rosen
* @Date:   2017-05-27 18:26:52
* @Last Modified by:   Rosen
* @Last Modified time: 2017-05-29 16:54:03
*/

'use strict';

var _mm = require('util/mm.js');

var _product = {
    // 获取酒店列表
    getProductList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/list'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //分页获取酒店列表
    getProductPageList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/page/list'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据品牌
    getSearchTermQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchTermQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据酒店名称分词
    getSearchMatchQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchMatchQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据酒店名称模糊查询
    getSearchWildcardQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchWildcardQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据销量排序
    getSearchSortQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchSortQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据价格范围
    getSearchRangeQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchRangeQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //根据价格范围
    getSearchBoolQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchBoolQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //自动提示
    getSearchSuggestInfoList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchSuggestInfo'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //高亮
    getSearchHighLightList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchHighLight'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //多域查询
    getSearchQueryStringQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchQueryStringQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //分组查询
    getSearchBrandGroupQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchBrandGroupQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //分组查询
    getSearchDateHistogramList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchDateHistogram'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //纠错查询
    getSearchFuzzyQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchFuzzyQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //加权查询
    getSearchScoreQueryList : function(listParam, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/hotel/searchScoreQuery'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },


    // 获取商品详细信息
    getProductDetail : function(productId, resolve, reject){
        _mm.request({
            url     : _mm.getServerUrl('/product/detail.do'),
            data    : {
                productId : productId
            },
            success : resolve,
            error   : reject
        });
    }
}
module.exports = _product;